using UnityEngine;

public class ArrangeAnchors : MonoBehaviour
{
	private void OnDrawGizmos()
	{
		RectTransform rectTransform = base.transform as RectTransform;
		RectTransform rectTransform2 = rectTransform.parent as RectTransform;
		Vector2 pivot = rectTransform2.pivot;
		float x = pivot.x;
		Vector2 pivot2 = rectTransform2.pivot;
		Vector2 pivot3 = new Vector2(x, pivot2.y);
		rectTransform2.pivot = Vector2.zero;
		Rect rect = rectTransform.rect;
		float width = rect.width;
		float height = rect.height;
		Vector3 localPosition = rectTransform.localPosition;
		float x2 = localPosition.x;
		Vector3 localPosition2 = rectTransform.localPosition;
		float y = localPosition2.y;
		Rect rect2 = rectTransform2.rect;
		rectTransform.anchorMin = new Vector2((x2 - width / 2f) / rect2.width, (y - height / 2f) / rect2.height);
		rectTransform.anchorMax = new Vector2((x2 + width / 2f) / rect2.width, (y + height / 2f) / rect2.height);
		rectTransform.offsetMax = Vector2.zero;
		rectTransform.offsetMin = Vector2.zero;
		rectTransform2.pivot = pivot3;
		UnityEngine.Object.DestroyImmediate(this);
	}
}
